%
%	$Header: snmptrap.tex,v 3.0 91/05/17 16:16:14 jrd Rel $
%	Author: J. Davin
%	Copyright 1988, 1989, Massachusetts Institute of Technology
%

\newpage
\subsection{The Snmptrap Command}

The snmptrap command directs an SNMP trap message
at a specified remote network management application.
It is coded to run in a BSD 4.3 UNIX environment.

The code for the snmptrap command illustrates the use of the
Development Kit to accelerate development
of network management applications as well as the
use of the SNMP protocol {\it trap} operation.

Sources for the snmptrap command reside in the
\verb"snmptrap" subdirectory of the Development Kit
distribution hierarchy.

It is invoked with the syntax:

{\bf snmptrap} [{\bf -h} {\it remoteHost}] [{\bf -p} {\it remotePort}]
[{\bf -c} {\it communityName}]
{\it enterprise} {\it agent-address} {\it generic-trap} {\it specific-trap}
{\it timestamp}
[{\it name kind value} ] $\ldots$

If the {\bf -h} flag is present, then the program
will send its trap message
to the IP address specified as {\it remoteHost.}

If the {\bf -p} flag is present, then the program
will send its trap message
to the UDP port specified as {\it remotePort,}
instead of that assigned to the ``snmp-trap'' service
in the \verb"/etc/services" database.

If the {\bf -c} flag is present, then the program
will generate and accept management requests
associated with the community name specified as {\it communityName,}
instead of using the community name ``public.''

For example, the command

snmptrap -h anyhost 1.3.6.1.4.1.42.1.1 18.26.0.115 4 0 999 1.3.6.1.2.1.1.1.0
OctetString "Fred Router by Flintstones Inc"

has the effect of sending to a management application at host {\it anyhost}
an SNMP trap message. The originator of the message is identified
by its enterprise value, 1.3.6.1.4.1.42.1.1 and its IP address,
18.26.0.115. The message is an authenticationFailure trap, type 4.
The time associated with this trap message is 999 time ticks, and
a standard MIB sysDescr value has been included as additional
information.

The kinds of values that are recognized as additional items
in a trap message are
\begin{quote}\small\begin{verbatim}
Integer
Counter
Guage
OctetString
ObjectId
IPAddr
TimeTicks
\end{verbatim}\end{quote}

